From: Ignacy KuchciƄski Date: Tue, 4 Nov 2025 22:07:54 +0000 (+0100) Subject: timeLimitsManager: Convert unix times to ISO 8601 X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~108 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=96221910c7f9a57dc2e13f838c77dcee2c949701;p=gnome-shell.git timeLimitsManager: Convert unix times to ISO 8601 Convert unix epoch times to ISO 8601 formatted strings for logging purposes. Part-of: --- diff --git a/js/misc/timeLimitsManager.js b/js/misc/timeLimitsManager.js index 1fa2c46ac..b99939778 100644 --- a/js/misc/timeLimitsManager.js +++ b/js/misc/timeLimitsManager.js @@ -467,7 +467,7 @@ export const TimeLimitsManager = GObject.registerClass({ if (debugLog) { console.debug('TimeLimitsManager: User state changed from ' + - `${userStateToString(oldState)} to ${userStateToString(newState)} at ${wallTimeSecs}s`); + `${userStateToString(oldState)} to ${userStateToString(newState)} at ${this._unixToString(wallTimeSecs)}`); } // This potentially changed the limit time and timeout calculations. @@ -751,6 +751,17 @@ export const TimeLimitsManager = GObject.registerClass({ return 0; } + /** + * Convert unix epoch to ISO 8601 formatted string for logging purposes. + * + * @param {number} secs Unix time to represent in human readable form + * @returns {string} + */ + _unixToString(secs) { + const dateTime = GLib.DateTime.new_from_unix_local(secs); + return dateTime.format_iso8601(); + } + _updateState() { console.assert(this._state !== TimeLimitsState.DISABLED, 'Time limits should not be disabled when updating timer');